package com.highper.common.configuration;

import com.highper.common.mq.SendHalfMessageRocketMQ;
import com.highper.common.mq.SendMessageRocketMQ;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

/**
 * @Author ZhangGJ
 * @Date 2022/01/29 11:24
 */
public class WakeRocketMQAutoConfigure {

    @Autowired
    private DefaultMQProducer defaultMQProducer;

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @Bean
    public SendHalfMessageRocketMQ sendHalfMessageRocketMQ() {
        return new SendHalfMessageRocketMQ(rocketMQTemplate);
    }

    @Bean
    public SendMessageRocketMQ sendMessageRocketMQ() {
        return new SendMessageRocketMQ(rocketMQTemplate);
    }
}
